﻿{include file="public/header" /}
<body>
<div class="x-body ">
  <form  class="layui-form">
    <div class="layui-form-item">
      <label for="admin_code" class="layui-form-label">编号</label>
      <span style="color: red">*</span>
      <div class="layui-input-inline">
        <input type="text" id="admin_code" name="admin_code" value="{$adminRow.admin_code}" lay-verify="required" disabled autocomplete="off" class="layui-input" >
        <input type="hidden" value="{$adminRow.id}" name="id">
        <p id="pLog" style="color:red"></p>
      </div>
    </div>


    <div class="layui-form-item">
      <label for="admin_name" class="layui-form-label">姓名</label>
      <div class="layui-input-inline">
        <input type="text" id="admin_name" name="admin_name" value="{$adminRow.admin_name}"  lay-verify="required" autocomplete="off" class="layui-input"  >
        <p id="pLog" style="color:red"></p>
      </div>
    </div>
    <div class="layui-form-item">
      <label for="password" class="layui-form-label">密码</label>
      <div class="layui-input-inline">
        <input type="text" id="password" name="password"  value="{$adminRow.password}"  lay-verify="required"  autocomplete="off" class="layui-input"  >
        <p id="pLog" style="color:red"></p>
      </div>
    </div>
    <div class="layui-form-item">
      <label for="tie" class="layui-form-label">手机</label>
      <div class="layui-input-inline">
        <input type="text" id="tie" name="tie"  value="{$adminRow.tie}"    autocomplete="off" class="layui-input"  >
      </div>
    </div>
    <div class="layui-form-item">
      <label for="mailbox" class="layui-form-label">邮箱</label>
      <div class="layui-input-inline">
        <input type="text" id="mailbox" name="mailbox"  value="{$adminRow.mailbox}" autocomplete="off" class="layui-input"  >
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label"></label>
      <button class="layui-btn" lay-submit lay-filter="addId">
        修改
      </button>
    </div>
  </form>
</div>
<script>
    layui.use(['form'], function(){
        $ = layui.jquery;
        var form = layui.form,layer = layui.layer;

        //监听提交
        form.on('submit(addId)', function(data){
            //console.log(data);
            $.post("{:url('index/Administrators/adminEdit')}",data.field,function(info){
                if (info) {
                    layer.alert("修改成功", {icon: 6},function () {
                        window.parent.location.reload();  //刷新父级页面
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前弹出层
                        parent.layer.close(index);
                    });
                }else{
                    layer.alert("修改失败", {icon: 5});
                }
            },'json');
            return false;
        });


    });
</script>
</body>

</html>